<?php
namespace app\admin\controller;
use app\common\controller\AdminController;
use app\common\model\Sms as  smsModel;

use think\facade\View;


class Sms extends AdminController {

    public function index(){
        if($this->request->isAjax()){
            $model = new smsModel;
            $re['code'] = 0;
            $re['msg'] = '';
            $re['data'] = [];
            $re['count'] = 0;
            $res = $model->order('created_at','desc')->paginate()->toArray();
            if(sizeof($res['data'])>0){
                $re['data'] = $res['data'];
                $re['count'] = $res['total'];
            }
            return $re;
        }else{
            return View::fetch();

        }
    }


}
